#pragma once

#include "SegmentSet.h"
#include "SegmentRow.h"
#include "DLL.h"

#include <vector>

namespace My {

class Xline;

class DLL_API SegmentSetRow : 
	public GridRow, 
	public TreeRow
{
public:
	SegmentSetRow(Xline &);
	~SegmentSetRow();
public:
	SegmentSet * GetSegments() const 
		{ return m_pSegments; }
	Xline & GetXline() const
		{ return m_Xline; }
	void SetSegments(SegmentSet *);
	void UpdateSegments();
public:
	void SetCaption(const String &);
public:
	virtual String GetCaption() const;
	virtual bool CanExpand() const
		{ return true; }
	virtual void HandleLeftDown(unsigned int, const CPoint &);
	virtual void HandlePaint(CDC *, const CRect &);
	virtual void PaintCell(CDC *, const CRect & rClip, const Column &, const CRect & rCell);
	virtual void ProcessEvent(My::Event &);
private:
	Xline &						m_Xline;
	String						m_Caption;
	SegmentSet *				m_pSegments;
	std::vector<SegmentRow *>	m_SegmentRows;
};

} // My